home *** CD-ROM | disk | FTP | other *** search
- Path: argonet.co.uk!argbe15
- From: Dave Mullard <dmullard@argonet.co.uk>
- Newsgroups: comp.lang.c++
- Subject: How to get at base class fields from member functions?
- Date: Sun, 17 Mar 1996 00:49:35
- Organization: UnipalmPIPEX server (post doesn't reflect views of UnipalmPIPEX
- Distribution: world
- Message-ID: <internews46B00D1FBD@argonet.co.uk>
- Reply-To: Dave Mullard <dmullard@argonet.co.uk>
- NNTP-Posting-Host: aj075.du.pipex.com
- X-Newsreader: VTi Voyager InterNews 0.15 for Acorn RISC OS (Patched by RA)
-
- Given three classes A, B and C I want to have multiple As for each B and
- multiple Bs for each C. To do this I could create the following.
-
- class b1 : public B
- {
- A a1;
- A a2;
- A a3;
- };
-
- class b2 : public B
- {
- A a1;
- A a2;
- A a3;
- A a4;
- A a5;
- };
-
- class c1 : public C
- {
- b1 b1;
- b2 b2;
- };
-
- The question is, how within functions for class B do I access fields
- within class C, and similarly, how within the class A functions do I
- access fields within class B?
-
- Any help would be appreciated.
-
- Thanks,
- ...
- --
- Dave Mullard <dmullard@argonet.co.uk>
-
-